ony upto here the rest is rough work